package com.francis.springbootcommonutil;

import java.util.regex.Pattern;

/**
 * <p>Title: CheckCarNo</p>
 * <p>Description: CheckCarNo  判断车牌号是否正确 </p>
 * <p>Copyright: ChenWei Copyright(c) 2018/p>
 *
 * @author ChenWei
 * @version 0.0.0.1
 * <pre>Histroy:
 *       2020/6/22 14:59 Create by ChenWei
 * </pre>
 */
public class CheckCarNo {

    /**
     * @param content
     * @return boolean
     * @methodName checkCarNumber
     * @description 判断车牌号是否正确
     * @author Fu Qiang
     * @date 2019/11/27 0027 10:23
     */
    public static boolean checkCarNumber(String content) {
        String pattern = "([京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼]{1}(([A-HJ-Z]{1}[A-HJ-NP-Z0-9]{5})|([A-HJ-Z]{1}(([DF]{1}[A-HJ-NP-Z0-9]{1}[0-9]{4})|([0-9]{5}[DF]{1})))|([A-HJ-Z]{1}[A-D0-9]{1}[0-9]{3}警)))|([0-9]{6}使)|((([沪粤川云桂鄂陕蒙藏黑辽渝]{1}A)|鲁B|闽D|蒙E|蒙H)[0-9]{4}领)|(WJ[京津沪渝冀豫云辽黑湘皖鲁新苏浙赣鄂桂甘晋蒙陕吉闽贵粤青藏川宁琼·•]{1}[0-9]{4}[TDSHBXJ0-9]{1})|([VKHBSLJNGCE]{1}[A-DJ-PR-TVY]{1}[0-9]{5})";
        return Pattern.matches(pattern, content);
    }
}
